import 'package:dio/dio.dart';
import 'package:get/get.dart';

import 'net_exception.dart';

class NetErrorInterceptor extends Interceptor {
  @override
  void onError(DioError err, ErrorInterceptorHandler handler) {
    NetException exception = NetException.create(err);
    Get.log('DioError====: ${exception.toString()}');
    err.error = exception;
    super.onError(err, handler);
  }
}
